﻿@using Lib.core;
@using Model.Sys;
    @{
        Layout = null;
        var list = ViewData["sliderlist"] as List<LinkModel>;
    }

    @if (ValidateHelper.IsPlumpList(list))
    {
                    <!--图片轮播-->
        <div style="padding-bottom: 20px;">
            <div id="slider" class="owl-carousel">
                @foreach (var slider in list)
                {
                    if (!ValidateHelper.IsPlumpString(slider.Image)) { continue; }
                    <div class="item">
                        <a href="@(slider.Url)" target="_blank">
                            <img src="@(slider.Image)" alt="@(slider.Title)" />
                        </a>
                    </div>
                }
            </div>
        </div>

                    <!--owl slider-->
        <link href="~/ui/jq-plus/owl/owl.carousel.css" rel="stylesheet" />
        <link href="~/ui/jq-plus/owl/owl.theme.css" rel="stylesheet" />
        <script src="~/ui/jq-plus/owl/owl.carousel.min.js"></script>

        <script type="text/javascript">
            $(function () {
                $("#slider").owlCarousel({ singleItem: true });
            });
        </script>

        <style type="text/css">
            #slider .item a, #slider .item img {
                display: block;
                width: auto;
                height: 200px;
            }
        </style>
    }
